/*
 * This file is part of TradeHelper library.
 *
 * TradeHelper library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TradeHelper library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TradeHelper library.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.rag.assistants;

import com.alee.laf.WebLookAndFeel;
import com.alee.utils.XmlUtils;
import com.rag.core.Updates;
import com.rag.managers.BaseManager;

import java.io.File;

/**
 * User: mgarin Date: 13.06.12 Time: 14:10
 */

public class UpdatesGenerator
{
    public static void main ( String[] args )
    {
        WebLookAndFeel.install ();
        BaseManager.initialize ();

        // Обновляем данные новостей
        AnnounceGenerator.generateAnnounce ();
        NewsGenerator.generateNews ();

        // Обновляем базу синонимов
        SynonymsGenerator.generateSynonyms ();

        // Архивируем данные
        DataZipper.zipData ();

        // Обновляем файл дат обновлений
        Updates updates = new Updates ();
        updates.setData ( new File ( "remote/data.xml" ).lastModified () );
        updates.setSynonyms ( new File ( "remote/synonyms.xml" ).lastModified () );
        XmlUtils.toXML ( updates, "remote/updates.xml" );

        System.exit ( 0 );
    }
}